/**
 * 
 */
package com.ntv.persistent.content;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.ntv.domain.Content;
import com.ntv.domain.IContent;

/**
 * @author Vedamoorthi Vairam
 * @since 06/01/2009
 *
 */
public class ContentMapper implements RowMapper 
{
	public Object mapRow(ResultSet rs, int rowNum) throws SQLException 
	{
		IContent content = new Content();
		
		content.setContentId(rs.getLong("content_id"));
		content.setContentSize(rs.getLong("content_size"));
		content.setContentType(rs.getString("content_type"));
		content.setCreatedBy(rs.getLong("created_by"));
		content.setCreatedOn(rs.getDate("created_on"));;
		content.setContent(rs.getBinaryStream("content"));
		content.setUpdatedBy(rs.getLong("updated_by"));
		content.setUpdatedOn(rs.getDate("updated_on"));
		content.setCaption("caption");
		return content;
	}

}
